//---------------------------------------------------------------------
// <copyright file="CsdlAssociationEnd.cs" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//---------------------------------------------------------------------

namespace Microsoft.Data.Edm.Csdl.Internal.Parsing.Ast
{
    /// <summary>
    /// Represents a CSDL association end.
    /// </summary>
    internal class CsdlAssociationEnd : CsdlNamedElement
    {
        private readonly CsdlTypeReference type;
        private readonly EdmMultiplicity multiplicity;
        private readonly CsdlOnDelete onDelete;

        public CsdlAssociationEnd(string role, CsdlTypeReference type, EdmMultiplicity multiplicity, CsdlOnDelete onDelete, CsdlDocumentation documentation, CsdlLocation location)
            : base(role, documentation, location)
        {
            this.type = type;
            this.multiplicity = multiplicity;
            this.onDelete = onDelete;
        }

        public CsdlTypeReference Type
        {
            get { return this.type; }
        }

        public EdmMultiplicity Multiplicity
        {
            get { return this.multiplicity; }
        }

        public CsdlOnDelete OnDelete
        {
            get { return this.onDelete; }
        }
    }
}
